home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1992 February
/
1992-02.d64
/
rpg codebuster
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
176 lines
5 rem copyright 1992 - compute publications intl ltd - all rights reserved
10 dim by$(15),cm$(15)
20 pt$=" abcdefghijklmnopqrstuvwxyz0123456789'-#"
30 as$="204142434445464748494a4b4c4d4e4f505152535455565758595a"
40 sc$="30313233343536373839272d23":as$=as$+sc$
50 hx$="0123456789abcdef"
60 print"insert character disk, press a key..."
70 geta$:ifa$=""then goto 70
80 open 15,8,15,"i"+"0"
90 open 2,8,2,"#"
100 print"rpg codebuster":print"run/stop to quit. options:"
110 print:print:print"(1) convert character stat to hex"
120 print:print:print"(2) convert name to probable bytes"
130 print:print:print"(3) find character disk block"
140 geta$:if a$="1" or a$="2" then goto 160
150 if a$<>"3" then goto140
160 if a$="1" then gosub 1320
170 if a$="1" then goto 100
180 if a$="2" then goto 330
190 print"choose method a,b or c:"
200 print:print:print"(a) left justified character trap"
210 print:print:print"(b) running (embedded) character trap"
220 print:print:print"(c) party initial trap"
230 geta$:if(a$<>"a"anda$<>"b")and a$<>"c" then goto230
240 fl=1:if a$="b" then fl=0
250 if a$="c" then fl=3:l1$="":l2$="":l3$="":i$=""
260 sf=0:print:print:print"change sector range default (y or n)?"
270 geta$:ifa$<>"y" and a$<>"n" then goto270
280 if a$="y" then sf=1
290 if fl<>3 then goto330
300 print"type party first initials"
310 input"in order, no spaces";rp$
320 goto340
330 input"type your character's name, then return";rp$
340 forj=1to15
350 h$=mid$(rp$,j,1):fort=1to40:if h$=mid$(pt$,t,1) then i=2*t-1:t=41
360 next
370 cm$(j)=mid$(as$,i,2)
380 if cm$(j)="20" then goto410
390 if mid$(cm$(j),1,1)="3" and a$<>"2" then cm$(j)="5"+mid$(cm$(j),2,1)
400 if mid$(cm$(j),1,1)="2" and a$<>"2" then cm$(j)="4"+mid$(cm$(j),2,1)
410 if fl=3 then i$=i$+cm$(j)
420 ifj=len(rp$)then j=16
430 next
440 if a$<>"2" then goto510
450 by$=""
460 fork=1tolen(rp$)
470 by$=by$+cm$(k):by$=by$+" ":next
480 print"probable disk bytes for name:"
490 print" ";by$
500 goto100
510 print"possible hot tracks - 27-30,17-20"
520 input"which starting track";t
530 input"which ending track";et
540 if t<1 or t>35 then goto520
550 if et<1 or et>35 then goto520
560 if t>et then goto520
570 print"this takes a while -- "
580 print"current track and sector"
590 print" being examined:"
600 s=0
610 print#15,"u1:2,"0;t;s
620 print#15,"b-p:2,1"
630 print#15,"m-r"chr$(0)chr$(5)
640 get#15,by$(0):if by$(0)="" then by$(0)=chr$(0)
650 f=1
660 print" ";t;s
670 forc=0to8
680 ford=fto15
690 get#2,by$(d)
700 if by$(d)="" then by$(d)=chr$(0)
710 next d:f=0
720 nm=1
730 if c=0 or c=1 then goto 750
740 if c<>8 then nm=0:goto1090
750 by$=""
760 ford=0to15
770 bn=asc(by$(d))
780 n1=int(bn/16)
790 b1$=mid$(hx$,n1+1,1)
800 n2=int(bn-16*n1)
810 b2$=mid$(hx$,n2+1,1)
820 fork=2to18step2
830 if b1$=mid$(hx$,k,1) then b1$="5"
840 next
850 if b1$<>"5" then b1$="4"
860 by$=b1$+b2$
870 if by$="40" then by$="20"
880 if fl=0 then goto920
890 if cm$(d+1)<>by$ then nm=0
900 if fl=1 and nm=0 then d=16:goto990
910 if d=len(rp$)-1 then d=16:goto990
920 by$(d)=by$
930 if fl<>3 then goto990
940 nm=0
950 if c=0 then l1$=l1$+by$:gosub1590
960 if c=1 then l3$=l3$+by$:gosub1590
970 if c=0 or c=8 then l2$=l2$+by$:gosub1590
980 if fl=3 then d=16
990 nextd
1000 if fl=1 or fl=3 then goto1090
1010 ford=0to15-len(rp$):nm=1
1020 if by$(d)<>cm$(1) then goto 1070
1030 fork=1tolen(rp$)-1
1040 if by$(d+k)<>cm$(k+1) then nm=0
1050 next
1060 if nm=1 then d=16:goto1080
1070 if d=15-len(rp$) then nm=0
1080 next
1090 if nm=1 then c=9
1100 next
1110 if nm=1 then goto1220
1120 s=s+1:gosub1150
1130 if t>et then goto1290
1140 goto610
1150 if sf=0 then sl=12:goto1200
1160 if t<18 then sl=20:goto1200
1170 if t<25 then sl=18:goto1200
1180 if t<31 then sl=17:goto1200
1190 if t<35 then sl=16
1200 if s>sl then s=0:t=t+1:l1$="":l2$="":l3$=""
1210 return
1220 print rp$" found -"
1230 print"track, sector:";t;s
1240 print"more rpg codebusting? (y or n)"
1250 geta$:if a$="" then goto1250
1260 close 15,8,15:close 2,8,2
1270 if a$="y" then goto 60
1280 end
1290 print rp$;" not yet found..."
1300 close 15,8,15:close 2,8,2
1310 goto 60
1320 ford=0to7:by$(d)="0":next
1330 print "no commas, please..."
1340 input"character stat";cs
1350 if cs>268435456 then print"figure too large for routine":return
1360 if cs=268435456 then by$(6)="1":goto1500
1370 if cs=16777216 then by$(7)="1":goto1500
1380 if cs>16777216 then dv=16777216:d=7:gosub1550
1390 if cs=1048576 then by$(4)="1":goto1500
1400 if cs>1048576 then dv=1048576:d=4:gosub 1550
1410 if cs=65536 then by$(5)="1":goto1500
1420 if cs>65536 then dv=65536:d=5:gosub 1550
1430 if cs=4096 then by$(2)="1":goto1500
1440 if cs>4096 then dv=4096:d=2:gosub1550
1450 if cs=256 then by$(3)="1":goto1500
1460 if cs>256 then dv=256:d=3:gosub1550
1470 if cs=16 then by$(0)="1":goto1500
1480 if cs>16 then dv=16:d=0:gosub1550
1490 by$(1)=mid$(hx$,cs+1,1)
1500 by$(0)=by$(0)+by$(1):by$(1)=by$(2)+by$(3)
1510 by$(2)=by$(4)+by$(5):by$(3)=by$(6)+by$(7)
1520 print"probable form of coded stat in block:"
1530 print by$(0),by$(1),by$(2),by$(3)
1540 return
1550 q=cs/dv:q=int(q)
1560 by$(d)=mid$(hx$,q+1,1)
1570 cs=cs-dv*q
1580 return
1590 if l1$=i$ then nm=1
1600 if l2$=i$ then nm=1
1610 if l3$=i$ then nm=1
1620 if nm=1 then c=9:return
1630 if len(l1$)=len(i$) then t$=l1$:goto1670
1640 if len(l2$)=len(i$) then t$=l2$:goto1670
1650 if len(l3$)=len(i$) then t$=l3$:goto1670
1660 goto1740
1670 fork=3tolen(t$)-1step2:w=len(t$)-(k-1):t2$=right$(t$,w):v=len(t2$)
1680 if t2$=mid$(i$,1,v)thenk=len(t$)
1690 next
1700 if mid$(t2$,1,2)<>mid$(i$,1,2) then t2$=""
1710 if len(l1$)=len(i$) then l1$=t2$:goto1740
1720 if len(l2$)=len(i$) then l2$=t2$:goto1740
1730 if len(l3$)=len(i$) then l3$=t2$
1740 return